$(function() {
  $('.mmb_nav').on('click','.more',function() {
    
  })

  $.ajax({
    url:'http://127.0.0.1:9090/api/getindexmenu',
    dataType: 'json',
    success: function(info) {
      console.log(info.result)
      var html = template('tmp',info)
      html = html.replace(/&#60;/g,'<')
      html = html.replace(/&#62;/g,'>')
      html = html.replace(/&#34;/g,'"')
      $('.nav_ul').html(html)

      $('.nav_ul li:nth-child(8)').on('click',function() {
        $('.nav_ul li:nth-last-child(-n+4)').toggleClass('hide')
      })
    }
  })

  $.ajax({
    url: 'http://127.0.0.1:9090/api/getmoneyctrl',
    dataType: 'json',
    success: function(info) {
      console.log(info)
      var result = info.result
      for(var i = 0 ; i < result.length; i++) {
        result[i].num = parseInt(result[i].productComCount.substring(1,3))
      }
      var html = template('tmp2',info)
      $('.mmb_cheap .content').html(html)
    }    
  })
  
})